import { notification } from 'antd';

export function deltaMinuteIsValid(deltaMinute: number, MAX_MINUTE = 24 * 60 * 2) {
    if (deltaMinute > MAX_MINUTE) {
        notification['error']({
            placement: 'bottomRight',
            message: '时间范围过大',
            description:
                '请减少选择的时间范围'
        });
        return false;
    }
    if (deltaMinute < 0) {
        notification['error']({
            placement: 'bottomRight',
            message: '时间选择错误',
            description:
                '请重新选择'
        });
        return false;
    }
    return true;
}